package com.usain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.usain.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserMapper extends BaseMapper<User> {
    void insertUser(User user);

    @Select("select * from user where userId=#{userId}")
    List<User> findAll(@Param("userId") Integer userId);

    @Select("select * from user")
    List<User> findList();

    @Delete("delete from user where userId=#{userId}")
    void deleteId(@Param("userId")Integer userId);
}
